<tagLib name="html" />
<include file="Public:headerNew" />
<load href="__PUBLIC__/Js/JqueryUI/jquery-ui-1.8.20.custom.min.js" />
<load href="__PUBLIC__/CSS/JqueryUI/jquery-ui-1.8.20.custom.css" />
<load href="__PUBLIC__/Js/Jquery/jquery.form.js" />
<load href='__PUBLIC__/Js/listtolist.js'/>
<div class="titleone"><h1 class="fLeft">添加商业用户信息</h1><a href="__URL__"><div class="returnimg"></div></a></div>
<div id="result" class="result none"></div>
<div id="main" class="main full" >


		<script type="text/javascript">
			
			$(function(){
	       		function checkForm(){

							if( '' == $.trim($('#name').val())){
											
									$('#result').html('名字不能为空').show();
							
											return false;
							
							}
							
							if('' == $.trim(zlist)){
								$('#result').html('未指定位置').show();
						
									return false;
											
							}
			

							

								
							//可以在此添加其它判断
		
						}
				//check 部分			
				$('body').addClass('has-js');
				 $('.label_check,.label_radio').click(function(){ setupLabel(); });
			  	setupLabel();

				$('#dialog').dialog({

					autoOpen: false,


					width: 260,
					modal : true,
					
					buttons: {

						"添加": function() { 
							moveOption(document.getElementById('zonesel'),document.getElementById('myzone'),0);

						}, 

						"关闭": function() { 

							$(this).dialog("close"); 

						} 

					}

				});

				

				// Dialog Link

				$('#addbuttonBlock').click(function(){

					$('#dialog').dialog('open');

					return false;

				});





				



				

				//hover states on the static widgets

				$('#dialog_link, ul#icons li').hover(

					function() { $(this).addClass('ui-state-hover'); }, 

					function() { $(this).removeClass('ui-state-hover'); }

				);

				$("#fselect").dblclick(function(){ $.listTolist("fselect","tselect","move",false,0);
		sortMe("tselect");
		
	}); 

    $("#tselect").dblclick(function(){ $.listTolist("tselect","fselect","move",false,1);
		sortMe("fselect");
	}); 

    $("#moveright").click(function(){ $.listTolist("fselect","tselect","move",false,0);
	sortMe("tselect");
	});
    $("#moveleft").click(function(){ $.listTolist("tselect","fselect","move",false,1);
	sortMe("fselect");
	}); 


			});
			function submitForm() { 
									// inside event callbacks 'this' is the DOM element so we first 
									// wrap it in a jQuery object and then invoke ajaxSubmit 
							//添加地区信息
						$('#form1').submit();
       					return false;	
								
   			};
function getZonsList(obj){
				var t_url="{:U('getZoneList?pid=')}"+$("#zoneid").val();

				$.ajax({
						url: t_url,
						type: 'GET',
						dataType: 'json',
						error: function(){
							alert('Error loading XML document');
						},
						success: function(data, textStatus){
							var json = eval(data['data']);
							$('#fselect').empty();
							if (json!=null){
							
							json.sort(function(a,b){
    								return a.id-b.id;
							});
						    for (var ind in json) {
								str = padRight(json[ind].name,20).replace(/\^/g,"&nbsp;");
							 	 $('#fselect').append('<option value="' + json[ind].id + '">'+ str + '面积:'+json[ind].place+']</option>');
								 //对面积数据数组赋值
									var itemx= new Array();
									itemx[0]=json[ind].id;
									itemx[1]=json[ind].name;
									itemx[2]=json[ind].place;
									
	                		}
							}
						}
				});
} 
	
			
</script>




<form method='post' id='form1' action='__URL__/insertBiz'  enctype="multipart/form-data">



		<!-- ui-dialog -->

<div class="metroTitle">添加新的商业机构</div>		
<ul class="pt_list" id="pt_list">

          <li  style="height:250px;">

                    <div class="thumb"><span>1</span></div>

                    <h3>基本信息</h3>

                    <div class="thumbr">
<table width="98%" cellpadding=3 cellspacing=3 >
<tr>
  <td width="160" height="20" class="tRight" >商户名称：</td>
  <td class="tLeft" ><input type="text"  name="name" id="name" class="metro"></td>
</tr>

<tr>
  <td height="20" class="tRight">状态：</td>
  <td class="tLeft"><select name="status" class="metro">
    <option value="1">启用</option>
    <option value="0">禁用</option>
    </select></td>
</tr>
<tr>
	<td height="20" class="tRight">地址：</td>
	<td align="left" class="center">
	  <textarea  name="address"  rows="1" cols="50" id="address"  class="metro"></textarea>
	 </td>
	</tr>
<tr>
	<td class="tRight tTop">简 介：</td>
	<td align="left" class="tLeft"><TEXTAREA  name="remark"  ROWS="3" COLS="50" id="remark"  class="metro"></TEXTAREA></td>
	</tr>

</table>
</div>
</li>
      <li  style="height:294px;">

                    <div class="thumb"><span>2</span></div>

                    <h3>使用商网情况</h3>

                    <div class="thumbr">
                    <table width="98%" border="0" cellspacing="3" cellpadding="3">
  <tr>
    <td class="tRight">物业使用面积：</td>
    <td class="tLeft"><input  name="znum" type="text" class="metro" id="znum" style="width:160px;" value="0" /></td>
    <td class="tRight">采暖使用面积：</td>
    <td class="tLeft"><input  name="znum2" type="text" class="metro" id="znum2" style="width:160px;" value="0" /></td>
  </tr>
  <tr>
    <td class="tRight" width="160">所在小区：</td>
    <td class="tLeft" width="195">
    <html:select name="zoneid" id="zoneid" change="getZonsList(this)"  first="选择区域" options="lista" selected="selectZoneGroupId" style="metro" /></td>
    <td class="tRight" width="160">&nbsp;</td>
    <td width="345" class="tLeft">&nbsp;</td>
  </tr>
  <tr>
    <td height="144" align="center">&nbsp;</td>
    <td height="144" colspan="3" class="tLeft"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td>商网列表</td>
        <td width="40">&nbsp;</td>
        <td class="tLeft">已选商网</td>
      </tr>
      <tr>
        <td><select name="fselect" size="8" multiple="multiple" id="fselect" style="width:220px" class="metro">
          <volist name="zonesList" id="vo">
            <option value="{$vo.id}">{$vo.name}&nbsp;&nbsp;&nbsp;&nbsp;[面积:{$vo.place}]</option>
          </volist>
        </select></td>
        <td><div id="moveright">&gt;&gt;</div>
          <br/>
          <div id="moveleft">&lt;&lt;</div></td>
        <td class="tLeft"><select name="tselect" size="8" multiple="multiple" id="tselect" style="width:220px" class="metro">
          <volist name="list" id="vo">
            <option value="{$vo.id}">{$vo.name}</option>
          </volist>
        </select></td>
      </tr>
    </table></td>
    </tr>
                    </table>
        </div>
    </li> 
 <li style="height:120px;">
 <div class="thumb"><span>3</span></div>

                    <h3>联系人信息</h3>

                    <div class="thumbr">
  <table width="98%" cellpadding="3" cellspacing="3" >
    <tr>
      <td width="160" height="20" class="tRight" >联系人：</td>
      <td class="tLeft" ><input type="text" class="metro medium bLeftRequire"  name="contact"  id="contact"/></td>
      <td width="160" class="tRight">手机：</td>
      <td class="tLeft" ><input type="text" class="metro medium bLeftRequire"  name="mobile"  id="mobile"/></td>

    </tr>
    <tr>
      <td height="20" class="tRight">联系电话：</td>
      <td class="tLeft"><input type="text" class="metro medium bLeftRequire"  name="tel" id="tel" /></td>
      <td width="160" class="tLeft">&nbsp;</td>
      <td class="tLeft">&nbsp;</td>

    </tr>
  </table>

                    </div>


            </li>             
 <li style="height:160px;">
 <div class="thumb"><span>4</span></div>

                    <h3>计量单价设定</h3>

                    <div class="thumbr">   
<table width="98%" cellpadding="3" cellspacing="3" >
  <tr>
    <td class="tRight"  width="160" height="20">水费单价</td>
    <td class="tLeft">
      <input type="text" class="metro medium bLeftRequire"  name="water"  id="water" value="<php>echo $setting['water'];</php>"/>
    </td>
    <td class="tRight"  width="160" height="22">电费单价</td>
    <td class="tLeft">
      <input type="text" class="metro medium bLeftRequire"  name="electricity"  id="electricity" value="<php>echo  $setting['electricity'];</php>"/>
    </td>
    </tr>
  <tr>
    <td class="tRight"  width="160" height="20">污水处理费单价</td>
    <td class="tLeft">
      <input type="text" class="metro medium bLeftRequire"  name="wastewater"  id="wastewater" value="<php>echo $setting['wastewater'];</php>"/>
    </td>
    <td class="tRight"  width="160" height="22">采暖费单价</td>
    <td class="tLeft">
      <input type="text" class="metro medium bLeftRequire"  name="heating"  id="heating" value="<php>echo $setting['heating'];</php>"/>
    </td>
    </tr>
  <tr>
    <td height="20" class="tRight">物业费单价</td>
    <td class="tLeft">
      <input type="text" class="metro medium bLeftRequire"  name="property"  id="property" value="<php>echo  $setting['property'];</php>"/>
    </td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    </tr>
</table>                    
                    
                                     </div>


      </li>   
 <li style="height:80px;">
 <div class="thumb"><span>5</span></div>

                    <h3>服务开通信息</h3>

                    <div class="thumbr">
 <script language="javascript">
    function setupLabel(){ if($('.label_check input').length) { 
		$('.label_check').each(function(){ $(this).removeClass('c_on'); });
		 $('.label_check input:checked').each(function(){ $(this).parent('label').addClass('c_on'); }); }; 
		 if($('.label_radio input').length) { $('.label_radio').each(function(){ $(this).removeClass('r_on'); });
		  $('.label_radio input:checked').each(function(){ $(this).parent('label').addClass('r_on'); }); }; 
	}
   </script><fieldset class="checkboxes">
<table width="900" cellpadding="3" cellspacing="3">
 
      
		  <tr>
		    <td width="20%"><label for="checkbox-01" class="label_check"><input type="checkbox" value="1" checked="checked" id="checkbox-01" name="sample-checkbox[]" />水费 </label></td>
		    <td width="20%"><label for="checkbox-02" class="label_check"> <input type="checkbox" value="2" checked="checked" id="checkbox-02" name="sample-checkbox[]" />电费</label> </td>
		    <td width="20%"><label for="checkbox-03" class="label_check"> <input type="checkbox" value="3" checked="checked" id="checkbox-03" name="sample-checkbox[]" />物业费</label> </td>
		    <td width="20%"><label for="checkbox-04" class="label_check"> <input type="checkbox" value="4" checked="checked" id="checkbox-04" name="sample-checkbox[]" />污水处理费</label></td>
		    <td width="20%"><label for="checkbox-05" class="label_check"> <input type="checkbox" value="5" checked="checked" id="checkbox-05" name="sample-checkbox[]" />采暖费</label></td>
		    </tr>
       </table> </fieldset>                 
                    
                    </div>
                    </li>    
          
            </ul>

<div class=cssClear></div>
    <div class="toolPanel">
        <div style="width:99%;margin:5px"><input type="hidden" name="ids" id="ids" value="" />
             <div class="impBtnN fRig"><a href="#" onclick="document.forms['form1'].reset()" id="buttonclearBlock" ></a></div>
            <div class="impBtnN fRig"><a href="#" onclick="submitForm();" id="buttonSaveBlock" ></a></div>
</form>           
        </div>
    </div>

</div>